#!/bin/bash


# 1. 询问用户是否确认卸载
read -p "【卸载警告】你是否确认卸载并知晓该操作不可恢复？(y/n): " confirm
if [ "$confirm" != "y" ]; then
    echo "【卸载】取消卸载。"
    exit 1
fi


# 停止docker容器并移除
echo '【卸载】即将停止docker容器并将其移除'
docker-compose -f docker-compose.yml down
echo '【卸载】停止docker容器并将其移除成功'

echo '【卸载】即将移除挂载目录'
# 移除挂载
rm -rf volumes
echo '【卸载】移除挂载目录成功'